import request from '@/utils/request';

// 获取工区
export function getWorkAreaList(query) {
  return request({
    url: `/sysm/dept/workAreaList`,
    method: 'get',
    params: query
  });
}

// 获取施工天窗
export function getWork(params) {
  return request({
    url: '/pspc/bigScreen/getWork',
    method: 'get',
    params
  });
}
// 获取检修天窗
export function getRepair(params) {
  return request({
    url: '/pspc/bigScreen/getRepair',
    method: 'get',
    params
  });
}

// 发生缺陷
export function getDefect(query) {
  return request({
    url: '/basic/basicHomePage/getDefect',
    method: 'get',
    params: query
  });
}

// 安全信息
export function getDaily(query) {
  return request({
    url: '/pspc/bigScreen/getDaily',
    method: 'get',
    params: query
  });
}

// 安全质量情况(局、段、车间首页)
export function getSafetySituation(query) {
  return request({
    url: '/basic/basicDoor/getFaultRecord',
    method: 'get',
    params: query
  });
}

// 缺陷情况(局、段、车间首页)
export function getDefectSituation(query) {
  return request({
    url: '/repair/door/getDoorDefect',
    method: 'get',
    params: query
  });
}

// 设备超周期(局级首页)
export function getDeviceOverdue(query) {
  return request({
    url: '/basic/basicDoor/getDeviceOverDue',
    method: 'get',
    params: query
  });
}

// 设备超周期(段级首页 - 按线路统计)
export function getPowerSupplyDeviceOverdue(query) {
  return request({
    url: '/basic/basicDoor/getPowerSupplyDeviceOverDue',
    method: 'get',
    params: query
  });
}

// 设备超周期(车间级首页 - 按线路统计)
export function getWorkShopDeviceOverdue(query) {
  return request({
    url: '/basic/basicDoor/getWorkShopDeviceOverDue',
    method: 'get',
    params: query
  });
}

// 设备超周期(段、车间级首页 - 按机构统计)
export function getDeviceOverdueByDept(query) {
  return request({
    url: '/basic/basicDoor/getDeviceOverDueByDept',
    method: 'get',
    params: query
  });
}

// 检修进度(局、段、车间首页 - 按线路统计)
export function getRepairAmount(query) {
  return request({
    url: '/repair/door/getRepairAmountByLineCode',
    method: 'get',
    params: query
  });
}

// 检修进度(段级首页 - 按机构统计)
export function getWorkshopRepairAmount(query) {
  return request({
    url: '/repair/door/getWorkshopMileageByIdPath',
    method: 'get',
    params: query
  });
}

// 检修进度(车间级首页 - 按机构统计)
export function getWorkareaRepairAmount(query) {
  return request({
    url: '/repair/door/getWorkshopMileageByCheJianIdPath',
    method: 'get',
    params: query
  });
}

// 总检修进度(局、段级首页)
export function getTotalRepairAmount(query) {
  return request({
    url: '/repair/door/getRepairAmountByLineType',
    method: 'get',
    params: query
  });
}

// 总检修进度(车间级首页)
export function getWorkShopTotalRepairAmount(query) {
  return request({
    url: '/repair/door/getRepairAmount',
    method: 'get',
    params: query
  });
}

// 重点工作
export function getKeyWork(query) {
  return request({
    url: '/sysm/sysmDoor/getDoorKeyWork',
    method: 'get',
    params: query
  });
}

// health map
export function getLineInter(query) {
  return request({
    url: '/gis/line/getVector',
    method: 'get',
    params: query
  });
}

export function getLineSiteInter(query) {
  return request({
    url: '/gis/lineSite/getVector',
    method: 'get',
    params: query
  });
}

// home/index.vue
// 待办事项
export function getTodoList(query) {
  return request({
    url: '/sysm/sysmBigScreen/getTodoListHandler',
    method: 'get',
    params: query
  });
}

// 预警提醒
export function getEarlyWarning(query) {
  return request({
    url: '/sysm/sysmBigScreen/getBreakdownHandler',
    method: 'get',
    params: query
  });
}

// 通知公告
export function getNotice(query) {
  return request({
    url: '/sysm/sysmBigScreen/getNoticeHandler',
    method: 'get',
    params: query
  });
}

// 重点工作
export function getKeyWork1(query) {
  return request({
    url: '/sysm/sysmBigScreen/getKeyWorkHandler',
    method: 'get',
    params: query
  });
}

// 个人工作台
export function getWorkBench(query) {
  return request({
    url: '/sysm/workBenchApp/',
    method: 'get',
    params: query
  });
}

// 维修天窗
export function getRepairSkylight(query) {
  return request({
    url: '/pspc/bigScreen/getRepair',
    method: 'get',
    params: query
  });
}

// 施工天窗
export function getConstructionSkylight(query) {
  return request({
    url: '/pspc/bigScreen/getWork',
    method: 'get',
    params: query
  });
}

// 维修进度
export function getRepairCount(query) {
  return request({
    url: '/repair/bigScreen/getRepairCount',
    method: 'get',
    params: query
  });
}

// 维修天窗，根据线路查询工区
export function findWorkAreaByLine(query) {
  return request({
    url: '/basic/deptSite/findWorkAreaByLine',
    method: 'get',
    params: query
  });
}

// 获取值班领导
export function getLeader(query) {
  return request({
    url: '/pspc/bigScreen/getLeader',
    method: 'get',
    params: query
  });
}

// 获取系统顶部导航
export function getRoleMenu(query) {
  return request({
    url: '/sysm/init/getRoleMenu',
    method: 'get',
    params: query
  });
}

// 获取系统底部导航
export function getRoleLink(query) {
  return request({
    url: '/sysm/wlmqcms/link/',
    method: 'get',
    params: query
  });
}

// 获取登入人的idPath，最多只精确到段
export function getLoginUserIdPath(query) {
  return request({
    url: '/repair/warning/getLoginUserIdPath/',
    method: 'get',
    params: query
  });
}

